<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<meta http-equiv="refresh" content="5; URL=/SomeTalk/talk.do">
<script type="text/javascript">

	function popUp(value){
		var url = 'pop_upReport.do?p_id='+value;
		open(url,'신고하기','toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=no,width=325,height=490'); 
	}

	 
	var show = 'D';
	
	$(function(){
		
		$('#contentTalk').focus();
		
		$('#viewBtn').click(function(event){
			$.getJSON('noListView.do',{
				listview:show
			},function(data){
				if(data.listview=='Y'){
					document.getElementById("viewSpan").innerHTML="보여짐";
				}
				if(data.listview=='N'){
					document.getElementById("viewSpan").innerHTML="안보여짐";
				}
				show = 'D';
				
			});
		});
	});
	
</script>

<div id="info">
	<h2><img src="./image/title_img2.jpg"/></h2>
</div>

<div id="talkForm">
	<div id="talkHeader" class="form-group">
		<div class="row">
			<div class="col-xs-12 talk-align-center">${pagingHtml }</div>
		</div>
	</div>
	
	<div id="talkBody">
		<div class="row">
			<div class="col-md-12 col-lg-12 col-sm-12 col-xs-12 talk-align-center talkCover">
				<c:if test="${type==3 }">
					<div class="col-md-2 col-lg-3 col-sm-2 col-xs-1"></div>
					<table class="col-md-8 col-lg-6 col-sm-8 col-xs-10 talks">
						<tr>
							<td><a href="/SomeTalk/list.do"><font color="green" size="5">아직 파트너를 찜하시지 않으셨어요~~<br>여러 여성분을 만나보시겠어요?</font></a></td>
						</tr>
					</table>
					<div class="col-md-2 col-lg-3 col-sm-2 col-xs-1"></div>
				</c:if>
			
				<c:if test="${type==2 }">
				<div class="col-md-2 col-lg-3 col-sm-2 col-xs-1"></div>
				<div class="col-md-8 col-lg-6 col-sm-8 col-xs-10 talks">
					<table class="table">
						<tr>
							<td class="deLabel" colspan="3">${talkDe.id}님의 정보</td>
							<td class="deLabel">
								<button type="button" class="btn btn-default" onclick="history.go(-1)">뒤로</button>
							</td>
						</tr>
						<tr>
							<td colspan="4"><img src="${pageContext.request.contextPath}/upload/${talkPro.image}" alt="First-slide" width="100px" height="150px"></td>
						</tr>
						<tr>
							<td class="deLabel">성별</td>
							<td>${talkDe.gender}</td>
							<td class="deLabel">이름</td>
							<td>${talkDe.name}</td>
							
						</tr>
						<tr>
							<td class="deLabel2">나이</td>
							<td>${talkPro.age}</td>
							<td class="deLabel2">성격</td>
							<td>${talkPro.charac}</td>
						</tr>
						<tr>
							<td class="deLabel">키</td>
							<td>${talkPro.height}</td>
							<td class="deLabel">체형</td>
							<td>${talkPro.bodyty}</td>
						</tr>
						<tr>
							<td class="deLabel2">직업</td>
							<td>${talkPro.job}</td>
							<td class="deLabel2">주소지</td>
							<td>${talkPro.home}</td>
						</tr>
						<tr>
							<td class="deLabel" colspan="4">자기소개</td>
						</tr>
						<tr>
							<td colspan="4" rowspan="3">${talkPro.content}</td>
						</tr>
					</table>
				</div>
				<div class="col-md-2 col-lg-3 col-sm-2 col-xs-1"></div>
				</c:if>
					<!-- 글목록  -->
				<c:if test="${type==1 }">
				<div class="col-md-2 col-lg-3 col-sm-2 col-xs-1"></div>
					<table class="col-md-8 col-lg-6 col-sm-8 col-xs-10 talks">
						<c:if test="${count==0 }">
							<tr>
								<td><font color="blue" size="5">${pName}님과 즐거운 대화를 시작해 보세요~~!!</font></td>
							</tr>
						</c:if>
						<c:if test="${count>0 }">
						<tr>
							<td valign="bottom">
							<c:forEach var="talk" items="${talkList }">
								<c:if test="${talk.writer==id}">
									
									<div class="talktalks col-xs-12 col-sm-12 col-md-12 col-lg-12">
										<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
										<div class="talktalkCase col-xs-6 col-sm-6 col-md-6 col-lg-6" align="left">
											<form role="form" class="talktalkForm col-lg-12 col-md-12 col-sm-12 col-xs-12">
												<ul class="col-lg-12 col-md-12 col-sm-12 col-xs-12 nocss">
													<li class="col-lg-12 col-md-12 col-sm-12 col-xs-12 nocss">
														<div class="col-lg-4 col-md-4 col-sm-4 col-xs-4 talkImage1" align="center">
															<img src="${pageContext.request.contextPath}/upload/${mImage}" width="95%" height="65%">
														</div>
														<div class="dropdown col-lg-8 col-md-8 col-sm-8 col-xs-8 talktalk" align="left">
															<a href="#" class="dropdown-toggle" data-toggle="dropdown">${talk.writer}</a>
															<ul class="dropdown-menu" role="menu">
																<li><span class="reportspan" onclick="location.href='/SomeTalk/talkDetail.do?id=${talk.writer }'">상세정보</span></li>
															</ul>
														</div>
														<div class="col-lg-8 col-md-8 col-sm-8 col-xs-8 talktalk">${talk.content }</div>
													</li>
												</ul>
											</form>
										</div>
										<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5"></div>
									</div>
								</c:if>
								<c:if test="${talk.writer!=id}">
									<div class="talktalks col-xs-12 col-sm-12 col-md-12 col-lg-12">
										<div class="col-xs-5 col-sm-5 col-md-5 col-lg-5"></div>
										<div class="talktalkCase col-xs-6 col-sm-6 col-md-6 col-lg-6" align="right">
											<form role="form" class="talktalkForm col-lg-12 col-md-12 col-sm-12 col-xs-12">
												<ul class="col-lg-12 col-md-12 col-sm-12 col-xs-12 nocss">
													<li class="col-lg-8 col-md-8 col-sm-8 col-xs-8 nocss">
														<div class="dropdown col-lg-12 col-md-12 col-sm-12 col-xs-12 talktalk" align="right">
															<a href="#" class="dropdown-toggle" data-toggle="dropdown">${talk.writer}</a>
															<ul class="dropdown-menu" role="menu">
																<li><span class="reportspan" onclick="location.href='/SomeTalk/talkDetail.do?id=${talk.writer }'">상세정보</span></li>
																<li><span class="reportspan" onclick="popUp(this.id)" id="${p_id }">신고</span></li>
															</ul>
														</div>
														<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 talktalk" align="right">${talk.content }</div>
													</li>
													<li class="col-lg-4 col-md-4 col-sm-4 col-xs-4 talkImage1">
														<div class="col-lg-12 col-md-12 col-sm-12 col-xs-12 talkImage2" align="center">
															<img src="${pageContext.request.contextPath}/upload/${pImage}" width="90%" height="65%">
														</div>
													</li>
												</ul>
											</form>
										</div>
										<div class="col-xs-1 col-sm-1 col-md-1 col-lg-1"></div>
									</div>
								</c:if>
							</c:forEach>
							</td>
						</tr>
						</c:if>
					</table>
				<div class="col-md-2 col-lg-3 col-sm-2 col-xs-1"></div>
				</c:if>
			</div>
		</div>
	</div>

	
	<c:if test="${type!=3 }">
		<div id="talkFooter" class="form-group">
			<div class="row">
				<div class="col-md-2 col-lg-2 col-xs-1 col-sm-2"></div>
				<div class="col-md-8 col-lg-8 col-xs-10 col-sm-8 text-center">
					<form role="form" action="/SomeTalk/talk.do" method="post" class="talkTags form-inline">
						<ul>
							<li>
								<div class="form-group">
									<input type="text" id="contentTalk" class="footerContent form-control" name="content" placeholder="보낼말" required maxlength="50">
									<button type="submit" class="btn btn-default">글쓰기</button>
									<button type="button" class="btn btn-warning" onclick="location.href='/SomeTalk/p_idSet.do?p_id=${p_id}'">손떼기</button>
									<div class="btn-group" id="dropdowns">
										<button type="button" class="btn btn-default" id="viewBtn"><span id="viewSpan">${statusview }</span></button>
										<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
										<span class="caret"></span>
										</button>
										<ul class="dropdown-menu" role="menu">
											<li class="dropdown-header reportspan2"></li>
											<li><span class="reportspan" onclick="show='N'">리스트에 안보여짐</span></li>
											<li><span class="reportspan" onclick="show='Y'">리스트에 보여짐</span></li>
										</ul>
									</div>
								</div>
							</li>
						</ul>
					</form>
				</div>
			</div>
		</div>
	</c:if>
</div>